package itesm.coler.data;

import itesm.coler.models.Word;
import java.util.ArrayList;

public interface WordDAO {

	 /**
     * Returns a list of all words from the database ordered by wordId. The list is never null and
     * is empty when the database does not contain any word.
     * @return A list of all words from the database ordered by wordId.
     * @throws DAOException If something fails at database level.
     */
	public ArrayList<Word> findAll();
	
	 /**
     * Returns a list of all words from the database of a given problem ordered by user ID. The list is never null and
     * is empty when the database does not contain any word.
     * @param problemId: The problemId of the problem the words belong to.
     * @return A list of all words from the database ordered by word ID.
     * @throws DAOException If something fails at database level.
     */
    public ArrayList<Word> findAllByProblem(Long problemId) throws DAOException;
    
    /**
     * Create the given word in the database and assign it to a given problem. The wordId must be unique, otherwise it will throw
     * IllegalArgumentException.  
     * @param word The word to be created in the database.
     * @param problemId The problemId the word belongs
     * @throws IllegalArgumentException If the wordId exists
     * @throws DAOException If something fails at database level.
     */
	  public int insertWordByProblem(Word word, Long ProblemId) throws IllegalArgumentException, DAOException;

	
}
